package com.xyyl.patient.service.user;

import java.util.List;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import com.xyyl.patient.core.support.Pager;
import com.xyyl.patient.entity.user.AccountRecord;
import com.xyyl.patient.mapper.user.AccountRecordMapper;
import com.xyyl.patient.vo.user.AccountRecordVo;

/**
 * @projectName:xyyl-patient-service
 * @ClassName: AccountRecordServiceImp
 * @Description:账户管理Service
 * @author chen
 * @date 2017年8月24日
 *
*/
@Service("accountRecordService")
public class AccountRecordServiceImp implements AccountRecordService {

	@Autowired
	private AccountRecordMapper accountRecordMapper;
	    
	@Override
	public List<AccountRecordVo> queryUserAccountRecoreList(Pager pager) {
		List<AccountRecordVo> accountRecordVos = Lists.newArrayList();

		List<AccountRecord> accountRecords = accountRecordMapper.queryForPage(pager);

		if (accountRecords != null && !accountRecords.isEmpty()) {
			AccountRecordVo accountRecordVo = null;
			for (AccountRecord accountRecord : accountRecords) {
				accountRecordVo = new AccountRecordVo();
				BeanUtils.copyProperties(accountRecord, accountRecordVo);

				accountRecordVos.add(accountRecordVo);
			}
		}
		return accountRecordVos;
	}

}
